﻿<!doctype html>
<html lang="zh">

	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>HTML5 canvas带渐变色的圆形进度条动画</title>
		<link rel="stylesheet" type="text/css" href="css/normalize.css" />
		<link rel="stylesheet" type="text/css" href="css/default.css">
		<link rel="stylesheet" href="css/page-styles.css">
		<link href="http://fonts.useso.com/css?family=Open+Sans:300" rel="stylesheet">
		<!--[if IE]>
		<script src="http://libs.useso.com/js/html5shiv/3.7/html5shiv.min.js"></script>
	<![endif]-->
	</head>

	<body>
		<div class="htmleaf-container">
			<header class="htmleaf-header">
				<h1>HTML5 canvas带渐变色的圆形进度条动画 <span>jQuery Plugin to draw animated circular progress bars</span></h1>
				<div class="htmleaf-links">
					<a class="htmleaf-icon icon-htmleaf-home-outline" href="http://www.jb51.net/" title="脚本之家" target="_blank"><span> 脚本之家</span></a>
					<a class="htmleaf-icon icon-htmleaf-arrow-forward-outline" href="http://www.jb51.net/" title="返回下载页" target="_blank"><span> 返回下载页</span></a>
				</div>
			</header>
			<div class="htmleaf-content bgcolor-8">
				<div class="circles">
					<div class="first circle">
						<span>no <br/> animation</span>
					</div>

					<div class="second circle">
						<strong></strong>
						<span>animation <br/> progress</span>
					</div>

					<div class="third circle">
						<strong></strong>
						<span>value <br/> progress</span>
					</div>

					<div class="forth circle">
						<span>solid fill, <br/> custom angle</span>
					</div>

					<div class="fifth circle">
						<span>image fill, <br/> custom sizes</span>
					</div>
				</div>
				<div class="htmleaf-demo center">
					<a href="#" id="demo-reset">Reset</a>
					<a href="#" id="demo-play">Play</a>
				</div>
			</div>

		</div>

		<script src="http://libs.baidu.com/jquery/2.1.1/jquery.min.js" type="text/javascript"></script>
		<script src="dist/circle-progress.js"></script>
		<script src="js/examples.js"></script>
		<script type="text/javascript">
		/*圆圈进度条示例*/
//		    var num=0.18;
//		    var per=num*100;
			$('.second.circle').circleProgress({
				value: 0.18,
				startAngle: -Math.PI / 2,
				size: 100,
				fill: {
					gradient: ['yellow', 'red']
				},
				emptyFill: 'rgba(0, 0, 0, .5)',
				animation: {
					duration: 2000,
					easing: 'circleProgressEasing'
				},
				lineCap: 'round'
			}).on('circle-animation-progress', function(event, progress) {
				$(this).find('strong').html(parseInt(18 * progress) + '<i>%</i>');
			});
		</script>
	</body>

</html>